home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 43
/
Aminet 43 (2001)(GTI - Schatztruhe)[!][Jun 2001].iso
/
Aminet
/
game
/
patch
/
WHDParadroid90.lha
/
WHD_Paradroid90
/
Install
< prev
next >
Wrap
Text File
|
2001-04-05
|
8KB
|
333 lines
;================================================================================
; CONFIGURATION SECTION
(set #CFG_APPNAME "Paradroid90")
(set #CFG_APPSLV "P90HD")
(set #CFG_APPGUI "Paradroid90")
(set #CFG_APPVER "R0401.1")
(set #CFG_APPCOPY "1999-2001")
;================================================================================
;------------------------------------------------------------------------------------
; Checks if given program is reachable via the path, if not abort install
;
; Entry: #VP1 = name of program to search for
(procedure P_CheckRun (
(if (<> 0 (run (cat "Which " #VP1)))(
(abort
(cat
"Could not find the program\n\n"
"'" #VPROGRAM "'\n\n"
"which is required to perform the installation!\n\n"
"Please install the '" #VPROGRAM "' program ensuring that"
" it is accessible on the path, then try the installation again."
)
)
))
))
;------------------------------------------------------------------------------------
; Create installation directories if required
(procedure P_InstallDirs (
;
; Create data dir if required
;
(if (<> 2 (exists #VDATDIR))(
(makedir #VDATDIR
(prompt "The directory '" #VDATDIR "' will now be created")
(help @makedir-help)
(confirm)
)
))
))
;------------------------------------------------------------------------------------
; Determine and set information about version of game being installed
;
(procedure P_SetVersionInfo (
; if the file exists, set version information
(if (< #VVERINFA 0)(
(if (= 1 (exists #VDATFILE))(
; determine version from CRC
(working "Determining game version")
(set #VT1
(run (cat "CRC16 \"" #VDATFILE "\" OFFSET=43520 LENGTH=299008"))
)
(set #VVERINFA 0)
(if (= #VT1 25338) (set #VVERINFA 1))
(if (= #VT1 8950) (set #VVERINFA 1))
))
))
; get memory size version information
(if (< #VVERINFB 0)(
(set #VVERINFB
(askbool
(prompt "Does your machine have more than 512Kb of chip (graphics) memory?")
(default 0)
(help @askchoice-help)
)
)
))
))
;------------------------------------------------------------------------------------
; Make game data
(procedure P_InstallGame (
;
; Set path to game data file
;
(set #VDATFILE (tackon #VDATDIR "Disk.1"))
;
; Install data files if not found or unknown versions
;
(P_SetVersionInfo)
(if (<= #VVERINFA 0)(
;
; Tell user what is happening
;
(message
(cat
"\n\n\nThe installer will now create the game data files\n"
"Follow the prompts to insert the game disks when required\n\n"
"Click 'Proceed' when ready."
)
)
;
; Call the imager slave
;
(working "Creating data files in '" #VDATDIR "'")
(copyfiles
(prompt "Copying disk image creation slave")
(help @copyfiles-help)
(source "ISlave")
(dest #VDATDIR)
(nogauge)
(optional fail force)
)
(set @execute-dir #VDATDIR)
(run (cat "RawDIC SLAVE=ISlave"))
(set @execute-dir #VOLDEXEDIR)
(delete (tackon #VDATDIR "ISlave") (optional force))
))
;
; Check the main data file was created and
; that we know this version of the game
;
(P_SetVersionInfo)
(if (= 0 #VVERINFA)
(abort
(cat "\n*** UNKNOWN VERSION OF GAME! ***\n\n"
"The installer does not recognise the version of the\n"
"game that you are trying to install.\n\n"
"Please contact the author for further information\n"
)
)
)
(if (= -1 #VVERINFA)
(abort
(cat "\n*** DATA FILES NOT CREATED! ***\n\n"
"The installer could not extract the game data files.\n\n"
"Please contact the author for further information\n"
)
)
)
))
;------------------------------------------------------------------------------------
; Install WHDLoad slave program
(procedure P_InstallSlave (
(working "Installing slave program")
; first, clean up previous installations
(set #VT1 (tackon #VDESTDIR "Paradroid90_HD"))
(if (= 1 (exists #VT1)) (delete #VT1 (optional force)) )
(set #VT1 (tackon #VDESTDIR "Paradroid90_HD.info"))
(set #VT2 (tackon #VDESTDIR "Paradroid90.info"))
(if (= 1 (exists #VT2))
(if (= 1 (exists #VT1)) (delete #VT1 (optional nofail force)) )
(if (= 1 (exists #VT1)) (rename #VT1 #VT2) )
)
(set #VT1 (tackon #VDESTDIR "ReadMe_1st"))
(if (= 1 (exists #VT1)) (delete #VT1 (optional force)) )
(set #VT1 (tackon #VDESTDIR "ReadMe_1st.info"))
(if (= 1 (exists #VT1)) (delete #VT1 (optional force)) )
; copy slave program
(set #VT1 "Slave")
(if (>= #VVERINFA 0) (set #VT1 (cat #VT1 #VVERINFA)) )
(if (>= #VVERINFB 0) (set #VT1 (cat #VT1 #VVERINFB)) )
(if (>= #VVERINFC 0) (set #VT1 (cat #VT1 #VVERINFC)) )
(copyfiles
(prompt "Copying slave program")
(help @copyfiles-help)
(source #VT1)
(newname #CFG_APPSLV)
(dest #VDESTDIR)
(nogauge)
(optional fail force)
)
; see if the user wants to replace their icon
(set #VT1 (cat #CFG_APPGUI ".info"))
(if (= 0 (exists (tackon #VDESTDIR #VT1)))(
; no icon exists, quietly copy one in
(set #VT2 1)
)(
; icon exists, ask user if they want to overwrite it
(set #VT2
(askbool
(prompt (cat "Do you want to replace the \"" #CFG_APPGUI "\" program icon (recommended) ?"))
(default 1)
(help @askchoice-help)
)
)
))
; do we have a slave icon?
(if (= 1 (exists "Slave.inf"))(
; copy slave icon, renaming to proper name along the way
(if (= 1 #VT2)(
(copyfiles
(prompt "Copying slave program icon")
(help @copyfiles-help)
(source "Slave.inf")
(newname #VT1)
(dest #VDESTDIR)
(nogauge)
(optional nofail force)
)
))
)(
; no slave icon so we must have a GUI to install
(copyfiles
(prompt "Copying GUI program")
(help @copyfiles-help)
(source "GUI")
(newname #CFG_APPGUI)
(dest #VDESTDIR)
(nogauge)
(optional fail force)
)
(if (= 1 #VT2)(
(copyfiles
(prompt "Copying GUI program icon")
(help @copyfiles-help)
(source "GUI.inf")
(newname #VT1)
(dest #VDESTDIR)
(nogauge)
(optional nofail force)
)
))
))
))
;------------------------------------------------------------------------------------
(welcome (cat "Welcome to the " #CFG_APPNAME " HD Installer"))
;
; Initialise
;
(set @app-name #CFG_APPNAME)
(set #VOLDEXEDIR @execute-dir)
(set #VVERINFA -1)
(set #VVERINFB -1)
(set #VVERINFC -1)
(set #VDESTDIR @default-dest)
;
; Check settings
;
(if (<> @user-level 2)
(abort "You must select 'Expert' user level")
)
(if (< @installer-version 2818051)
(abort "This product requires at least version 43.3 of the Installer program")
)
;
; Check required programs are available
;
(set #VP1 "CRC16")
(P_CheckRun)
(set #VP1 "RawDIC")
(P_CheckRun)
(set #VP1 "WHDLoad")
(P_CheckRun)
;
; Welcome message
;
(message "\n\nWelcome to the " #CFG_APPNAME " HD Installer"
"\n© " #CFG_APPCOPY " John Girvin/Halibut Software\n\n"
"Please read the documentation thoroughly "
"before attempting to use this installer!\n\n"
"This is release " #CFG_APPVER "\n\n"
"Click 'Proceed' to begin..."
)
;
; Get directory to install in
;
(set #VDESTDIR
(askdir
(prompt "Where would you like the game installed?\n"
"If you have an existing installation select that directory,\n"
"otherwise create / select the directory to install the game into."
)
(help @askdir-help)
(default @default-dest)
(disk)
(newpath)
)
)
(set #VDESTDIR (expandpath #VDESTDIR))
(set @default-dest #VDESTDIR)
(set #VDATDIR (tackon #VDESTDIR "data/"))
;
; Create the installation directories
;
(P_InstallDirs)
;
; Install the game data
;
(P_InstallGame)
;
; Install the slave
;
(P_InstallSlave)
;================================================================================
;$VER: Paradroid90 Installer script R0401.1 © 1999-2001 John Girvin/Halibut Software;================================================================================